/**
 * 
 */
package com.nus.iss.ad.dbhelper;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONObject;

import android.os.StrictMode;
import android.os.StrictMode.ThreadPolicy;

import com.nus.iss.ad.model.User;
import com.nus.iss.ad.utils.JsonParser;

/**
 * @author Sachin
 *
 */
public class UserDBHelper {
	
	public static final String KEY_ROWID = "_Id";
	public static final String KEY_USERNAME = "username";
	public static final String KEY_PASSWORD = "password";
	public static final String KEY_REMEMBER = "remember";
	
	
	private User user;
	private List<User> productList = new ArrayList<User>();
	
	
		// saves new record
	public boolean createProduct(User user) {
		StrictMode.setThreadPolicy(ThreadPolicy.LAX);
		 JSONObject userJSON = new JSONObject();
	        try {
	            userJSON.put("ProductId", user.get(UserDBHelper.KEY_USERNAME));
	            userJSON.put("Name", user.get(UserDBHelper.KEY_PASSWORD));
	            
	            
	            
	        } catch (Exception e) {
	        }
	        String jsonCustomer = userJSON.toString();
	        String result = JsonParser.postStream
	            ("http://10.10.0.210/WCFSachin/Service.svc/Save", jsonCustomer);
	        
	        
	        //setResult(RESULT_OK);
	        //finish();
	        
	        return true;
		
	}

	
}
